package cn.lijunkui.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import cn.lijunkui.mybaties.annotation.ProductMapper;
import cn.lijunkui.mybaties.annotation.domain.Product;

import javax.annotation.Resource;

@RestController
public class ProductController {
    @Resource
    private ProductMapper productMapper;

    @GetMapping("/productList/{id}")
    public Product findById(@PathVariable(name = "id") Long id) {
        return productMapper.findById(id);
    }
}
